home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
IDLIncludes
/
NameRegistry.idl
< prev
next >
Wrap
Text File
|
1996-05-01
|
20KB
|
597 lines
/*
File: NameRegistry.idl
Contains: NameRegistry Interfaces
Version: Technology: System 8
Release: Universal Interfaces 3.0d3 on Copland DR1
Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
Bugs?: If you find a problem with this file, send the file and version
information (from above) and the problem description to:
Internet: apple.bugs@applelink.apple.com
AppleLink: APPLE.BUGS
*/
#ifndef __NAMEREGISTRY_IDL__
#define __NAMEREGISTRY_IDL__
#include <somobj.idl>
#include <somcls.idl>
#ifndef __TYPES_IDL__
#include <Types.idl>
#endif
#ifdef __SOMIDL__
#if FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE
/*
These definitions apply to both the System7 and System8 interfaces
RegEntryRef: The Global Entry Reference
*/
typedef SOMLargeStruct RegEntryRef; /* Derived from a struct of 16 bytes in size */
typedef OpaquePtr RegPropertyNameBuf; /* Substituted OpaquePtr for array of char of size 32 */
#endif
#if FOR_SYSTEM8_PREEMPTIVE
/*
------------------------------------------------------------------------------------
Name Registry Interface for System 8
------------------------------------------------------------------------------------
*/
/*
------------------------------------------------------------------------------------
Foundation Types
------------------------------------------------------------------------------------
*/
/* Entry Name Definitions (Entry Names are C-Strings)*/
/* length of RegEntryNameBuf = kRegMaxEntryNameLength +1*/
typedef OpaquePtr RegEntryNameBuf; /* Substituted OpaquePtr for array of char of size 48 */
/* Create Entry Options*/
typedef OptionBits RegCreateEntryOptions;
/* use "kNilOptions" for no options*/
/* Delete Entry Options*/
typedef OptionBits RegDeleteEntryOptions;
/* use "kNilOptions" for no options*/
/* Entry Iterator*/
typedef OpaquePtr RegEntryIterator;
/* Entry Iterator Options*/
typedef OptionBits RegEntryIteratorOptions;
/* use "kNilOptions" for no options*/
/*
Property Instances
An instance value for a property is assigned by the Name Registry when the
instance is created. This value is used to distinguish this instance from any
other instances of the property. Instance values are unique and persistent for
the life of the property. Thus, clients can obtain a reference to a property (name
and instance value) and use that reference until the property is deleted or the
system is restarted. At restart, new instance values are assigned to all
properties, including any restored persistent properties.
*/
typedef UInt32 RegPropertyInstance;
/* Create Property Options*/
typedef OptionBits RegCreatePropertyOptions;
/* use "kNilOptions" for no options*/
/* Property Iterator*/
typedef OpaquePtr RegPropertyIterator;
/* Transaction Reference*/
typedef OpaquePtr RegTransaction;
/* Nil Transaction Reference*/
/*
------------------------------------------------------------------------------------
Name Registry Calls
------------------------------------------------------------------------------------
*/
/*
------------------------------------------------------------------------------------
EntryRef Handling
------------------------------------------------------------------------------------
*/
/* Compare two EntryRef's for equality. */
/*
------------------------------------------------------------------------------------
Adding and Deleting Entries
------------------------------------------------------------------------------------
*/
/*
Create an Entry
If (parentEntry) is NULL, the path name is assumed to be an absolute path name
rooted to the anonymous, unnamed root.
Note, RegCreateEntry only creates a single entry, the one at the end of the path.
Thus, all parent entries along the path to the new entry (ancestors) must already
exist.
*/
/*
Delete an Entry or Subtree
RegDeleteEntry can be used to delete a single entry or a complete subtree.
To delete a subtree, set the RegDeleteEmbedded option.
All properties for deleted entries are also deleted.
*/
/*
------------------------------------------------------------------------------------
LookUp Entry by Name
------------------------------------------------------------------------------------
*/
/*
Lookup Entry
Locates an entry given a specified subroot (searchPointRef) and path name. If the
searchPointRef pointer is NULL, the path name is assumed to be an absolute path
name rooted to the root of the Registry.
*/
/*
------------------------------------------------------------------------------------
Get Entry Name and Parent
------------------------------------------------------------------------------------
*/
/*
Retrieve the name component for the specified entry, and return the EntryRef for
the parent entry.
*/
/*
------------------------------------------------------------------------------------
Get Path Name
------------------------------------------------------------------------------------
*/
/*
These are utility routines to turn an Entry ID back into a name string.
Get Entry Path Size
Note, path size is returned in bytes for C-String paths
*/
/* Get Path Name*/
/*
------------------------------------------------------------------------------------
Entry Iteration
------------------------------------------------------------------------------------
*/
/*
An Entry Iterator maintains three variables that are of interest to clients.
First is an "OutermostScope" which defines the outer boundry of the iteration.
This is defined by the starting entry and includes that entry plus all of it's
embedded entries. Second is a "currentScope" which is the entry the iterator is
currently in. And third is a "currentPosition" which is the last entry returned
during an iteration.
Create Entry Iterator
Create the iterator structure. The outermostScope and currentScope of the iterator
are set to "startEntry". If "startEntry" = NULL, the outermostScope and
currentScope are set to the root entry. The currentPosition for the iterator is
set to "nil".
If propertyName != Null, propertyName, propertyValue, and propertySize are used
to filter the entries returned during an iteration. If propertyName == Null, all
entries are returned.
*/
/* Dispose Entry Iterator*/
/*
Enter Child Entry
Move an Entry Iterator into the scope of a specified child entry. The
currentScope of the iterator is set to the entry specified in "childEntry". If
"childEntry" is nil, the currentScope is set to the entry specified by the
currentPosition of the iterator.
Note RegEnterEntry cannot be used if the "kRegIterateEmbeddedEntries" option was
set when the iterator was created.
*/
/*
Exit to Parent Entry
Move an Entry Iterator out of the current entry back into the scope of it's parent
entry. The currentPosition of the iterator is reset to the current entry (the
previous currentScope), so the next iteration call will continue where it left off.
This position is returned in parameter "currentPosition".
Note RegExitEntry cannot be used if the "kRegIterateEmbeddedEntries" option was
set when the iterator was created.
*/
/*
Iterate Entries
Iterate and return entries contained within the entry defined by the current
scope of the iterator. If kRegIterateEmbeddedEntries option was specified when the
iterator was created, all embedded entries will be included in the iteration. If a
property selection (name , value, and size) was specified when the iterator was
created, the only entries having a matching property are returned. Entries are
returned one at a time. When OSStatus == nrIterationDone, all entries have been exhausted, and the
value of nextEntry will be Nil. If changed == true, one or more changes (entry
create or delete) occured since the last interation call.
*/
/*
Restart Entry Iteration
Restart an iteration within the current scope. The iterator is reset such that
iteration of the contents of the currentScope entry can be restarted. The
outermostScope and currentScope of the iterator are unchanged. The currentPosition
for the iterator is set to "nil".
*/
/*
------------------------------------------------------------------------------------
Adding and Deleting Properties
------------------------------------------------------------------------------------
*/
/*
Create Property
A single instance property is created by default. To create a multiple-instance
property set the kRegMultiInstanceProperty option. The next instance of the
property will be created and the instance value will be returned in
propertyInstance.
*/
/*
Delete Property
To delete a property the desired property instance(s) must be explicitly
identified. To delete a single instance property set propertyInstance to
kRegNilPropertyInstance. To delete all instances of a multi-instance property, set
propertyInstance to kRegAllPropertyInstances. Otherwise, propertyInstance must
be set to a valid instance value.
*/
/*
------------------------------------------------------------------------------------
Get/Set Property Values
------------------------------------------------------------------------------------
*/
/*
Get/Set the value of the specified property for the specified entry. To get, get
size, and set property values the desired property instance must be explicitly
identified. For single instance properites propertyInstance must be set to
kRegNilPropertyInstance. Otherwise, propertyInstance must be set to a valid
instance value.
Get Property size
*/
/* Get Property*/
/* Set Property*/
/*
------------------------------------------------------------------------------------
Iterating Properties
------------------------------------------------------------------------------------
*/
/*
Create Property Iterator
Create the property iterator structure. The target entry is defined by entryRef.
If a propertyName is specified, only property instances having the specified name
are returned. If propertyName == nil, all properties are returned.
*/
/* Dispose Property Iterator*/
/*
Iterate Properites
Iterate and return properties for given entry. If a propertyName was specified
when the iterator was created, then only property instances for that name are
returned. Otherwise, all properties are returned. The return value in
propertyInstance will be kRegNilPropertyInstance if the property is single
instance. Else it will contain the instance value for the property. If
changed == true, one or more changes (property creates or deletes) occured since the
last iterate call. When OSStatus == nrIterationDone, all properties have been exhausted.
*/
/*
Restart Property Iteration
Used to re-iterate over a list of properties. The Property Iterator is reset to
the beginning of the list of properties for an entry.
*/
/*
------------------------------------------------------------------------------------
Transaction-control calls
------------------------------------------------------------------------------------
*/
/*
Begin Transaction
Marks the beginning of a sequence of Name Registry calls that compose a Registry
transaction. An internal data structure for the transaction is created and a
reference to the transaction is returned in "tranasaction". This reference must be
used with all subsequence Name Registry calls pertaining to the transaction. The
transaction reference must be disposed using a RegCommitTransaction or
RegAbortTranscation call.
*/
/*
Commit Transaction
Commits the changes made to the registry for a sepecified transaction. All changes
(entry create/delete, property create/delete, and property value update) made for
the transaction are atomically integrated into the Registry. If result ==
nrTransactionAborted, there was a conflict with changes from some other transaction,
and this transaction was aborted, i.e., no changes for this transaction were made.
In this case the transaction should be repeated.
Note that RegCommitTransaction always disposes the transcation reference
independant of the outcome of the transaction. So to repeat a transaaction you
must start over with a RegBeginTransaction call.
*/
/*
Abort Transaction
Aborts the changes made to the registry for a sepecified transaction. All changes
(entry create/delete, property create/delete, and property value update) made for
the transaction are disgarded.
RegAbortTransaction also disposes of the transcation reference.
*/
#endif
#if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
/*
------------------------------------------------------------------------------------
Name Registry Interface for PowerSurge 1.0.2
------------------------------------------------------------------------------------
*/
/*
* Name Registry - API for device driver name registration
*
* This interface provides access to the namespace used
* by device drivers. The data structures and entry points
* are specialized and simplified for device driver use.
*/
/*
//////////////////////////////////////////////////////////////////////////////
//
// Data Structures
//
*/
/*
//////////////////////////////////////////////////////////////////////////////
//
// Foundation Types
//
*/
/* Value of a property */
typedef OpaquePtr RegPropertyValue; /* Substituted OpaquePtr for ``void*'' */
/* Length of property value */
typedef UInt32 RegPropertyValueSize;
/*
//////////////////////////////////////////////////////////////////////////////
//
// RegEntryID : The Global x-Namespace Entry Identifier
//
*/
/* RegEntryID: The Global Entry ID*/
typedef RegEntryRef RegEntryID;
typedef OpaquePtr RegEntryIDPtr; /* Substituted OpaquePtr for ``RegEntryID*'' */
/*
//////////////////////////////////////////////////////////////////////////////
//
// Root Entry Name Definitions (Applies to all Names in the RootNameSpace)
//
// * Names are a colon-separated list of name components. Name components
// may not themselves contain colons.
// * Names are presented as null-terminated ASCII character strings.
// * Names follow similar parsing rules to Apple file system absolute
// and relative paths. However the '::' parent directory syntax is
// not currently supported.
*/
/* Max length of Entry Name */
/* Entry Names are single byte ASCII */
typedef char RegCStrEntryName;
typedef OpaquePtr RegCStrEntryNamePtr; /* Substituted OpaquePtr for ``char*'' */
/* length of RegCStrEntryNameBuf = kRegCStrMaxEntryNameLength+1*/
typedef OpaquePtr RegCStrEntryNameBuf; /* Substituted OpaquePtr for array of char of size 48 */
typedef char RegCStrPathName;
typedef UInt32 RegPathNameSize;
/*
//////////////////////////////////////////////////////////////////////////////
//
// Property Name and ID Definitions
// (Applies to all Properties Regardless of NameSpace)
*/
typedef char RegPropertyName;
typedef OpaquePtr RegPropertyNamePtr; /* Substituted OpaquePtr for ``char*'' */
/*
//////////////////////////////////////////////////////////////////////////////
//
// Iteration Operations
//
// These specify direction when traversing the name relationships
*/
typedef UInt32 RegIterationOp;
typedef RegIterationOp RegEntryIterationOp;
/*
//////////////////////////////////////////////////////////////////////////////
//
// Name Entry and Property Modifiers
//
//
// Modifiers describe special characteristics of names
// and properties. Modifiers might be supported for
// some names and not others.
//
// Device Drivers should not rely on functionality
// specified as a modifier.
*/
typedef UInt32 RegModifiers;
typedef RegModifiers RegEntryModifiers;
typedef RegModifiers RegPropertyModifiers;
/* Universal Property Modifiers */
/*
///////////////////////
//
// The Registry API
//
///////////////////////
*/
/*
///////////////////////
//
// Entry Management
//
///////////////////////
*/
/*
-------------------------------
* EntryID handling
*/
/*
* Initialize an EntryID to a known invalid state
* note: invalid != uninitialized
*/
/*
* Compare EntryID's for equality or if invalid
*
* If a NULL value is given for either id1 or id2, the other id
* is compared with an invalid ID. If both are NULL, the id's
* are consided equal (result = true).
*/
/*
* Copy an EntryID
*/
/*
* Free an ID so it can be reused.
*/
/*
-------------------------------
* Adding and removing entries
*
* If (parentEntry) is NULL, the name is assumed
* to be a rooted path. It is rooted to an anonymous, unnamed root.
*/
/*
---------------------------
* Traversing the namespace
*
* To support arbitrary namespace implementations in the future,
* I have hidden the form that the place pointer takes. The previous
* interface exposed the place pointer by specifying it as a
* RegEntryID.
*
* I have also removed any notion of returning the entries
* in a particular order, because an implementation might
* return the names in semi-random order. Many name service
* implementations will store the names in a hashed lookup
* table.
*
* Writing code to traverse some set of names consists of
* a call to begin the iteration, the iteration loop, and
* a call to end the iteration. The begin call initializes
* the iteration cookie data structure. The call to end the
* iteration should be called even in the case of error so
* that allocated data structures can be freed.
*
* Create(...)
* do {
* Iterate(...);
* } while (!done);
* Dispose(...);
*
* This is the basic code structure for callers of the iteration
* interface.
*/
typedef OpaquePtr RegEntryIter;
/*
* create/dispose the iterator structure
* defaults to root with relationship = kRegIterDescendants
*/
/*
* set Entry Iterator to specified entry
*/
/*
* Return each value of the iteration
*
* return entries related to the current entry
* with the specified relationship
*/
/*
* return entries with the specified property
*
* A NULL RegPropertyValue pointer will return an
* entry with the property containing any value.
*/
/*
--------------------------------
* Find a name in the namespace
*
* This is the fast lookup mechanism.
* NOTE: A reverse lookup mechanism
* has not been provided because
* some name services may not
* provide a fast, general reverse
* lookup.
*/
/*
---------------------------------------------
* Convert an entry to a rooted name string
*
* A utility routine to turn an Entry ID
* back into a name string.
*/
/*
* Parse a path name.
*
* Retrieve the last component of the path, and
* return a spec for the parent.
*/
/*
//////////////////////////////////////////////////////
//
// Property Management
//
//////////////////////////////////////////////////////
*/
/*
-------------------------------
* Adding and removing properties
*/
/*
---------------------------
* Traversing the Properties of a name
*
*/
typedef OpaquePtr RegPropertyIter;
/*
* Get the value of the specified property for the specified entry.
*
*/
/*
* (*propertySize) is the maximum size of the value returned in the buffer
* pointed to by (propertyValue). Upon return, (*propertySize) is the size of the
* value returned.
*/
/*
//////////////////////////////////////////////////////
//
// Modibute (err, I mean Modifier) Management
//
//////////////////////////////////////////////////////
*/
/*
* Modifiers describe special characteristics of names
* and properties. Modifiers might be supported for
* some names and not others.
*
* Device Drivers should not rely on functionality
* specified as a modifier. These interfaces
* are for use in writing Experts.
*/
/*
* Get and Set operators for entry modifiers
*/
/*
* Get and Set operators for property modifiers
*/
/*
* Iterator operator for entry modifier search
*/
/*
* Iterator operator for entries with matching
* property modifiers
*/
#endif
#endif /* __SOMIDL__ */
#endif /* __NAMEREGISTRY_IDL__ */